<?php
/* ========== Include Configuration files ========== */
include_once('config/other_config.php');

/* ========== Turning error reporting off php (error_reporting(E_ERROR | E_WARNING | E_PARSE))========== */
    //error_reporting(0);
/* ========== Garbage Collection ========== */
    gc_enable(); // Enable Garbage Collector
    gc_collect_cycles(); // # of elements cleaned up
    gc_disable(); // Disable Garbage Collector

/* ========== Get all created class from the library ========== */
    function _autoloadClass($class)
    {
        $path = realpath(dirname(__FILE__) . "/library/" . $class . ".php");
        include_once($path);
    }
    spl_autoload_register("_autoloadClass");

/* ========== Load Content ========== */
$uri = new Layout();

    $allowed_folder = unserialize(ALLOWED_FOLDER);
    $params = $uri->getParams();
    if(!empty($params)){
        if(in_array($params[0],$allowed_folder)){
            // Dynamic Load subfolder module
            $uri->render_dynamic_folder_subView();
        }else{
            // Default Module
            $uri->renderContent();
        }
    }else{
        // Default Module
        $uri->renderContent();
    }









